package src.lab02.test11;

/**
 * Created by 林云志 on 2017/11/16.
 */
public class Rectangle implements Printx{
    //属性
    double length = 6;
    double width = 5;

    //构造函数
    Rectangle(int length,int width){
        this.length = length;
        this.width = width;
    }




    //方法
    public double area(double length, double width){
        double area = length * width;
        return area;
    }

    public double primeter(double length,double width){
        double primeter = (length+width)*2;
        return primeter;
    }

    @Override
    public void printMyWay() {
        System.out.println("长为："+length+"  宽为："+width+"  面积为："+area(length,width)+"  周长为："+primeter(length,width));
    }
}
